package com.platform.controller.backend;

import com.github.pagehelper.PageInfo;
import com.platform.common.ServerResponse;
import com.platform.pojo.Psac0001;
import com.platform.service.IPsacService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 供应商基础信息控制层
 */
@Controller
@RequestMapping("/pascController/")
public class PsacController {

    @Autowired
    private IPsacService iPsacService;

    @RequestMapping(value = "selectByUserName.do",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<Psac0001> selectByUserName(String userName){
        return iPsacService.selectByUserName(userName);
    }

    @RequestMapping(value = "selectByParam.do",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<PageInfo> selectByParam(@RequestParam Map paramMap){
        return iPsacService.selectByParam(paramMap);
    }

    @RequestMapping(value = "selectById.do",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<Map> selectById(Integer id){
        return iPsacService.selectById(id);
    }

    @RequestMapping(value = "selectOneById.do",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<Psac0001> selectOneById(Integer id){
        return iPsacService.selectOneById(id);
    }


    @RequestMapping(value = "insert.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<String> insert(Psac0001 psac0001){
        return iPsacService.insert(psac0001);
    }

    @RequestMapping(value = "update.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<String> update(Psac0001 psac0001){
        return iPsacService.update(psac0001);
    }

}
